/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ForceRendererPanel.java
 *
 * Created on 23 nov. 2011, 21:30:29
 */
package gui;

import flowvis.ForceRenderer;
/**
 *
 * @author Adrien
 */
public class ForceRendererPanel extends javax.swing.JPanel {
    
    ForceRenderer forceRenderer;

    /** Creates new form ForceRendererPanel */
   public ForceRendererPanel(ForceRenderer forceRenderer ) {
        initComponents();
        this.forceRenderer = forceRenderer;
        vColoringCombobox.setSelectedIndex( forceRenderer.getColoring() );
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        vColoringCombobox = new javax.swing.JComboBox();

        vColoringCombobox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Gray scale", "Rainbow", "Rainbow (banded)", "Black body", "Black body (banded)" }));
        vColoringCombobox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vColoringComboboxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(vColoringCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(262, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(vColoringCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(269, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

private void vColoringComboboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vColoringComboboxActionPerformed
        forceRenderer.setColoring( vColoringCombobox.getSelectedIndex() );
}//GEN-LAST:event_vColoringComboboxActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox vColoringCombobox;
    // End of variables declaration//GEN-END:variables
}
